                                                                     
                                                                     
                                                                     
                                             
package br.great.classes;

public class TexteRange {

    int i1;
    int i2;
    int i3;
    String[] stringB;

    public String[] getInfo(String s) {
        i1 = s.indexOf("(");
        i2 = s.indexOf(")");
        i3 = s.indexOf(",");
        stringB = new String[2];
        stringB[0] = s.substring(i1 + 1, i3);
        if (s.substring(i3 + 1, i2).startsWith(" ")) {
            stringB[1] = s.substring(i3 + 1, i2).substring(1);
        } else {
            stringB[1] = s.substring(i3 + 1, i2);
        }
        return stringB;
    }

    public String[] getInfoWithEspace(String s) {
        i1 = s.indexOf("(");
        i2 = s.indexOf(")");
        i3 = s.indexOf(" ");
        stringB = new String[2];
        stringB[0] = s.substring(i1 + 1, i3);
        stringB[1] = s.substring(i3 + 1, i2);
        return stringB;
    }

    public static String tradeText(String s) {
        s = s.trim();
        if (s.contains("'")) {
            s = s.replace("'", "''");
        }
        return s;
    }

    public static String changeFirstLetter(String word) {
        StringBuffer sb = new StringBuffer(word);
        if (sb.length() > 0) {
            if (sb.charAt(0) >= 'a' || sb.charAt(0) <= 'z') {
                if (Character.isLowerCase(sb.charAt(0))) {
                    String s = Character.toUpperCase(sb.charAt(0)) + "";
                    sb.replace(0, 1, s);
                }
            }
        }
        return sb.toString();
    }
//    public static void main(String[] args){
//        TexteRange tr = new TexteRange();
//        String[] B = tr.getInfo("(45.194276,5.731633)");
//        System.out.println(B[1]);
//    }
}   
    